SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwlBienes
AS
SELECT     dbo.Tb_Bienes.IDBien AS ID, dbo.Tb_Bienes.Descripcion, dbo.vwrRubrosBienes.Descripcion AS Rubro, dbo.vwrTiposDeBienes.Descripcion AS Tipo, 
                      dbo.vwrUnidadesDeMedida.Descripcion AS UnidadMedida, dbo.Tb_Bienes.Activo
FROM         dbo.Tb_Bienes INNER JOIN
                      dbo.vwrTiposDeBienes ON dbo.Tb_Bienes.Tipo = dbo.vwrTiposDeBienes.ID INNER JOIN
                      dbo.vwrRubrosBienes ON dbo.Tb_Bienes.Rubro = dbo.vwrRubrosBienes.ID INNER JOIN
                      dbo.vwrUnidadesDeMedida ON dbo.Tb_Bienes.UnidadMedida = dbo.vwrUnidadesDeMedida.ID
GO
GRANT SELECT ON  [dbo].[vwlBienes] TO [AdministracionEscolar]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionComprasySuministros]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionContable]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionDeposito]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionInventario]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionServiciosEscolares]
GRANT SELECT ON  [dbo].[vwlBienes] TO [GestionSubsidiosyRendiciones]
GRANT SELECT ON  [dbo].[vwlBienes] TO [Informatica]
GRANT SELECT ON  [dbo].[vwlBienes] TO [SoloVer]
GO
